package com.luych.toolbox.common.feign.view.base.service;

import com.luych.toolbox.common.feign.FeignView;
import com.luych.toolbox.common.feign.param.gateway.center.WebSocketLetter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel("站内信信息")
public class LetterView extends FeignView {

    @ApiModelProperty("用户ID")
    private String userId;
    @ApiModelProperty("类型")
    private WebSocketLetter.Type type;
    @ApiModelProperty("标题")
    private String message;
    @ApiModelProperty("内容")
    private String content;
    @ApiModelProperty("是否已读")
    private Boolean readed;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public WebSocketLetter.Type getType() {
        return type;
    }

    public void setType(WebSocketLetter.Type type) {
        this.type = type;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Boolean getReaded() {
        return readed;
    }

    public void setReaded(Boolean readed) {
        this.readed = readed;
    }

    public String getSummary() {
        if (this.content == null) return null;
        if (this.content.length() < 20) {
            return this.content;
        }
        return this.content.substring(0, 20) + "...";
    }
}
